<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>登录</title>

<link rel="stylesheet" type="text/css" href="css/login.css">

<script type="text/javascript" src="js/jquery-easyui-1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="js/login.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<body>

<div id="container">
	<div id="output">
		<div class="containerT">
			<h1>XXXXXX管理系统登录</h1>
			<form class="form" id="entry_form" action="">
			<div id="msg"></div>
				<input type="text" placeholder="用户名" id="entry_name" >
				<input type="password" placeholder="密码" id="entry_password">
				<div> <a style="margin-right:20%;">用户注册!</a>   <a>忘记密码？</a>  </div>
				<br/>
				<button type="button" id="entry_btn">登录</button>
				<div id="prompt" class="prompt"></div>
			</form>
		</div>
	</div>
</div>

<script type="text/javascript">
    $(function(){
        Victor("container", "output");   //登录背景函数
        $("#entry_name").focus();
        $(document).keydown(function(event){
            if(event.keyCode==13){
                $("#entry_btn").click();
            }
        });
        
        $("#entry_btn").click(function(){
        	 var loginInfo = Base64.encode(document.getElementById("entry_name").value+"&"+ document.getElementById("entry_password").value); 
        	//登录
        $.ajax({
			url : "login/toLogin",
			type : "post",
			dataType : "json",
			async : false,
			data : {"loginInfo":loginInfo},
			success : function(data) {
				if(data!=null){
					if(data.status=="0"){
						//跳转页面
						window.location.href='toMainPage';
					}else{
						$("#msg").html(data.msg);
					}
					
					
				}
			}
		});
        	
        })
        
        
    });
</script>
</body> 
</html>